package com.Socket;

public class Word {
	public static void printWord(String str) {

		String[] a = str.split(": ");
		String str1 = a[0];
		char[] s = a[1].toCharArray();
		ThreadWord tw = new ThreadWord(str1, s);
		Thread t = new Thread(tw);
		t.start();
	}
}

class ThreadWord implements Runnable {
	char[] s;
	String str;

	ThreadWord(String str, char[] s) {
		this.s = s;
		this.str = str;
	}

	@Override
	public void run() {
		System.out.print(str + ": ");
		for (int i = 0; i < s.length; i++) {
			try {
				Thread.sleep(200);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			System.out.print(s[i]);
		}
		System.out.println();
	}

}
